package string;

public class IndexOfDemo {
    public static void main(String[] args) {
        String str = "thinking in java";
        System.out.println(str.indexOf("in"));//2
        System.out.println(str.indexOf("in",5));//5
        System.out.println(str.lastIndexOf("in"));//9
        System.out.println(str.lastIndexOf("in",8));//5

    }
}
